<template>
	<view class="flex-col page">
		<view>
			<view :style="{height:statusBarHeight+'px'}"></view>
			<u-navbar title="商品收藏" bgColor="#F5F5F5" @leftClick="$nav(2)">	
			</u-navbar>
		</view>
		
		
		<view class="flex-col" v-if="list.length > 0">
			<ProductItem :list="list"></ProductItem>
		</view>
		
		<view v-else class="flex-col items-center" style="margin-top: 80rpx;">
			<image src="/static/data_empty.png"></image>
			<text style="color: #c0c4cc;">暂无数据</text>
		</view>
		
	</view>
</template>

<script>
	import ProductItem from '@/components/product-item.vue';
	export default {
		data() {
			return {
				list:[]
			};
		},
		components:{
			ProductItem
		},
		computed:{
			statusBarHeight(){
				return this.$store.state.statusBarHeight + 44
			}
		},
		onLoad() {
			this.getCollectList();
		},
		onShow() {
			
		},
		methods:{
			getCollectList(){
				this.$request({
					url:'?c=User&a=productCollection',
					type:'post'
				}).then(res =>{
					if(res.data != null){
						this.list = res.data
					}
				})
			}
		}
	}
</script>

<style lang="scss">
.page{
	width: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	height: 100vh;
}
</style>
